home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1995 November / Macworld Nov ’95.toast / Developers / Selection ƒ 2.5 / event+ < prev    next >
Encoding:
Text File  |  1994-11-06  |  732 b   |  39 lines  |  [TEXT/MSET]

  1. (*
  2. A few new methods for class event.  We should probably just revise our event
  3. class to contain these methods instead of changing the class of fevent.
  4. *)
  5.  
  6. :class event+ super{ event } 
  7.  
  8.  \ ? will be non-zero if the given key is down
  9.  
  10. :m commandKey?:  ( -- ? )
  11.     konst cmdKey  mods: fevent  and ;m
  12.     
  13. :m shiftKey?:  ( -- ? )
  14.     konst shiftKey  mods: fevent  and ;m
  15.     
  16. :m capslockKey?:  ( -- ? )
  17.     konst alphaLock  mods: fevent  and ;m
  18.     
  19. :m optionKey?:  ( -- ? )
  20.     konst optionKey  mods: fevent  and ;m
  21.     
  22. ;class
  23.  
  24.  
  25. \ now we change the class of fevent to event+ !!
  26.  
  27. fevent ' event+ set_class  30 ' fevent w!
  28.  
  29.  
  30. endload
  31.  
  32. *** EXAMPLE USE
  33.  
  34. Try this from the Mops front end window with and without the shift key 
  35. pressed:
  36.  
  37. shiftKey?: fevent .  
  38.  
  39.